#!/usr/bin/env python
#coding: utf-8
#

from redishelper import RedisHelper
import json
rediscli = RedisHelper()

result = rediscli.subscribe('fm95.5')
templates = {
 	'template_1':{
		'load':{
				'interval':5,
				'plugin_name':'get_load_inof',
				'last_time':0
		},

	},
}

for key,value in templates.items():
	rediscli.set(key,json.dumps(value))

i = 1 
while True:
	data = result.parse_response()
	print data[2]
	print '=======================',i
	i+=1
	# for i in result.listen():
	# 	print i
